package com.rd.student.ruanjian.class4.zhangrui.day8_2.review;

public class ReviewSleep {
    public static void main(String[] args) {
        //sleep()让正在执行的线程暂停一段时间，并进入阻塞状态
        long before = System.currentTimeMillis();
        System.out.println(before);//计算时间差
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        long after = System.currentTimeMillis();
        System.out.println(after);
        System.out.println(after - before);
    }
}
